From: Jonas Dreßler Date: Wed, 19 Feb 2020 10:53:05 +0000 (+0100) Subject: lookingGlass: Also handle null objects in objectToString X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~772^2^2~104 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=26a49168ba2abcd60e66f64c3a3dcf8deda0c1e8;p=gnome-shell.git lookingGlass: Also handle null objects in objectToString Whoops, while ff4623454 fixed the handling of `undefined` objects, `null` objects obviously still don't have a toString() method. So also handle those and return 'null' in case the object is null. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1024 --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 54e3e4858..ed0186cc2 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -244,7 +244,13 @@ function objectToString(o) { // special case this since the default is way, way too verbose return ''; } else { - return o !== undefined ? o.toString() : 'undefined'; + if (o === undefined) + return 'undefined'; + + if (o === null) + return 'null'; + + return o.toString(); } }